<?php
namespace Products\Model;

class Buy
{
	public $buy_id;
	public $category_id;
	public $product_id;
	public $user_id;
	public $business_user_id;
	public $order_for_quantity;
	public $order_for_price;
	public $order_date_time;
	public $order_status;
	public $company_name;
	public $genericname;
	public $parent_user_id;
	public $email;
	public $user_type;
	public $status;
	public $date;
	public $saleing;
	public $type;
	public $updatenote;
	
	public function exchangeArray($data){
	
		$this->buy_id            = (isset($data['buy_id']))         ? $data['buy_id']  : null;
		$this->category_id       = (isset($data['category_id']))    ? $data['category_id']	  : null;		
		$this->product_id        = (isset($data['product_id']))     ? $data['product_id']  : null;		
		$this->user_id           = (isset($data['user_id']))        ?     $data['user_id']  : null;		
		$this->business_user_id  = (isset($data['business_user_id']))? $data['business_user_id']   : null;
		$this->order_for_quantity  = (isset($data['order_for_quantity']))? $data['order_for_quantity']    : null;
		$this->order_for_price   = (isset($data['order_for_price']))   ? $data['order_for_price']   : null;
		$this->order_date_time   = (isset($data['order_date_time']))  ? $data['order_date_time']     : null;
		$this->order_status      = (isset($data['order_status']))   ?      $data['order_status']  : null;			
		$this->company_name      = (isset($data['company_name']))    ?      $data['company_name']  : null;
        $this->genericname      = (isset($data['genericname']))      ?        $data['genericname']  : null;		
        $this->parent_user_id      = (isset($data['parent_user_id']))      ?        $data['parent_user_id']  : null;		
        $this->email      = (isset($data['email']))      ?        $data['email']  : null;		
        $this->user_type      = (isset($data['user_type']))      ?        $data['user_type']  : null;	
		$this->status      = (isset($data['status']))      ?        $data['status']  : null;		
        $this->date      = (isset($data['date']))      ?        $data['date']  : null;
		$this->saleing      = (isset($data['saleing']))      ?        $data['saleing']  : null;		
		$this->type      = (isset($data['type']))      ?        $data['type']  : null;		
		$this->updatenote      = (isset($data['updatenote']))      ?        $data['updatenote']  : null;		
	}

	// Add the following method:
	public function getArrayCopy()
	{
		return get_object_vars($this);
	}

}